package win.somereason.test.baseline_web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import win.somereason.test.baseline_web.common.AuthHelper;
import win.somereason.test.baseline_web.entity.SecUserDetails;

/**
 * Created by Qingsheng.Sun on 2018/3/13.
 */
@Controller
@RequestMapping("home")
public class HomeController {
    @RequestMapping("index")
    public ModelAndView index() {
        SecUserDetails userInfo = AuthHelper.getCurrentUser();
        return new ModelAndView().
                addObject("userName", userInfo.getUsername());
    }
}
